﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AlgorithmThinks.DynamicProgramming;

namespace AlgorithmThinksConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            var result = LongestCommonSubstring.Action1("cgvdfxcbhngrfdrjsrtdgfy45347945dsfg45sd4gvb5fhertyhgaesz", "54645fgdfgwesrtew46sdgsdfsedfsdfsdg45645");
            sw.Stop();
            Console.Write("最长公共子串为：{0},长度为{1}",result,result.Length);
            Console.Write("所用时间：{0}",sw.ElapsedMilliseconds);

            Console.ReadLine();
        }

        /// <summary>
        /// 爬楼梯算法测试
        /// </summary>
        private static void Question1Test()
        {
            Console.WriteLine("请输入楼梯最多阶数");
            int n = Convert.ToInt32(Console.ReadLine());
            long[] result = new long[n];
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            for (int i = 1; i <= n; i++)
            {
                result[i - 1] = AlgorithmThinks.DynamicProgramming.Question1.Action4(i);
            }
            sw.Stop();

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("{0}阶楼梯有{1}种方式", i + 1, result[i]);
            }
            Console.WriteLine("所用时间{0}毫秒", sw.ElapsedMilliseconds);
        }
    }
}
